//
//  ZBYLListVC.swift
//  ZYA
//
//  Created by 邱仙凯 on 2024/9/19.
//  Copyright © 2024 zwb. All rights reserved.
//

import UIKit

class ZBYLListVC: ZB_BaseListVC {
    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "招标(原料)"
        tableView.register(ZB_BaseListCell.self, forCellReuseIdentifier: ZB_BaseListCell.identifier)

    }
    override func configAPI() {
      
        api = API.tender(.queryZbInfoList(z_begin_dt: self.helper.filterPa!.startDate, z_end_dt: self.helper.filterPa!.endDate, z_city: self.helper.filterPa!.zCity, z_price_min: self.helper.filterPa!.minMoney, z_price_max: self.helper.filterPa!.maxMoney, page: "\(page)", size: "10", z_title: self.helper.filterPa!.searchTitle, z_sort: self.helper.filterPa!.zSort, query_type: "3",z_status: self.helper.filterPa!.zStatus, followTag: "",s_data_source: ""))
    }
    
    
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let one = self.dataArray[indexPath.row]
        
        guard let cell = tableView.dequeueReusableCell(withIdentifier: ZB_BaseListCell.identifier, for: indexPath) as? ZB_BaseListCell else {
            fatalError("cell error")
        }
        
        cell.makeConstrainsts()
        
        one.innerType = .jpInfo_oaOA
        cell.chujiaBtn.addTouchUpInSideAction { [one, unowned self] btn in
        
        
            
            let  vc = YL_showPriceList()
            vc.z_zb_id = one.idKey.unwrap
            self.navigationController?.pushViewController(vc, animated: true)
//       
            
        }
        cell.one = one
        
        return cell
  
    }
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        var idkey:String = ""
     
            idkey = self.dataArray[indexPath.row].idKey.unwrap
      
        
    go2TenderInfoController(listType: .TB, fromVC:self,idkey:idkey,voccd: "",innerType:.zbListKHW)
    }
}
